package edu.ustb.mis.dm.model;

import java.util.Map.Entry;

public class KVPair implements Comparable<KVPair> {
	private String key;

	private Integer value;

	public KVPair(final Entry<String, Integer> entry) {
		this.key = entry.getKey();
		this.value = entry.getValue();
	}

	public int compareTo(final KVPair o) {
		return Double.compare(o.getValue(), this.getValue());
	}

	public String getKey() {
		return key;
	}

	public Integer getValue() {
		return value;
	}

	public void setKey(final String key) {
		this.key = key;
	}

	public void setValue(final Integer value) {
		this.value = value;
	}
}
